package com.springboot.blog.beans;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "blog_id", type = IdType.AUTO)
    private Integer  blogId;

    @TableField(value = "blog_title")
    private String blogTitle;

    @TableField(value = "blog_content")
    private String blogContent;

    @TableField(value = "blog_classify_id")
    private String  blogClassifyId;

    @TableField(value = "blog_classify_name")
    private String blogClassifyName;

    @TableField(value = "blog_status")
    private Byte blogStatus;

    private String images;

    @TableField(fill = FieldFill.INSERT,value = "blog_views")
    private Integer blogViews;

    @TableLogic
    @TableField(fill = FieldFill.INSERT,value = "blog_deleted")
    private Integer blogDeleted;

    @TableField(fill= FieldFill.INSERT,value = "blog_create_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date blogCreateTime;

    @TableField(fill = FieldFill.INSERT_UPDATE,value = "blog_update_time")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date blogUpdateTime;

    @TableField(value = "blog_user_username")
    private String blogUserUsername;
}
